package com.hxj.admin.szjy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hxj.admin.szjy.pojo.po.Dist;
import com.hxj.admin.szjy.mapper.DistMapper;
import com.hxj.admin.szjy.service.DistService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hxj
 * @since 2025-01-30
 */
@Service
public class DistServiceImpl extends ServiceImpl<DistMapper, Dist> implements DistService {

    @Override
    public List<Dist> getDistsByDistNo(String distNo) {
        LambdaQueryWrapper<Dist> queryWrapper = new LambdaQueryWrapper<Dist>().like(Dist::getDistno, distNo + "%");
        int distLen;
        switch( distNo.length() ) {
            case 2:
                distLen = 4;
                break;
            case 4:
                distLen = 6;
                break;
            default:
                distLen = 9;
                break;
        }
        queryWrapper.eq(Dist::getDistno, distLen);

        return null;
    }
}
